Release 10.1A: OpenEdge Development:
Programming Interfaces


OpenEdge database connection functions

Table 1–2 lists the Progress functions that allow you to test database connections, get information on connected databases, and get information on the types of databases that you can access.

Table 1–2: Progress database functions
Progress function
Description
CONNECTED 
Tests whether a given database is connected.
DATASERVERS 
Returns a character string containing a list of database types supported by the installed OpenEdge product. For example, “OpenEdge,ORACLE.”
DBTYPE 
Returns the database type of a currently connected database. For example “OpenEdge,” “ORACLE,” etc.
DBRESTRICTIONS 
Returns a character string that describes the OpenEdge features that are not supported for a particular database. For example, if the database is an ORACLE database, the return string is: “LAST,PREV,RECID,SETUSERID”.
DBVERSION 
Returns a “7” if a connected database is a Version 7 database and an “8” if it is a Version 8 database. For non-OpenEdge databases, you see the appropriate version number of your database.
FRAME–DB 
Returns a character string that contains the logical name of the database for the field in which the cursor was last positioned for input.
NUM–DBS 
Returns the number of connected databases.
LDBNAME 
Returns the logical name of a currently connected database.
PDBNAME 
Returns the physical name of a currently connected database.
SDBNAME 
Returns the logical name of a schema holder for a database.

Some of these functions take arguments; for more information on these functions, see the OpenEdge Development: Progress 4GL Reference .

Use these functions to perform various tasks related to connection, such as determining connection status. The following procedure displays a status report for all connected databases:

i-infor.p
DEFINE VARIABLE x AS INTEGER FORMAT "99". 
DO x = 1 TO NUM-DBS WITH DOWN: 
  DISPLAY PDBNAME(x) LABEL "Physical Database"  
    LDBNAME(x) LABEL "Logical Name" 
    DBTYPE(x) LABEL "Database Type"  
    DBRESTRICTIONS(x) LABEL "Restrictions" 
    SDBNAME(LDBNAME(x)) LABEL "Schema Holder DB". 
END. 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095